function dologin() {
	$.ajax({
		url : "dologin.do",
		type : "post",
		dataType : "text",
		data : $('#ff').serialize(),
		success : function(data) {
			var json = $.parseJSON(data);
			if (json.result === '1') {
				window.location.href = "student.html";
			} else {
				alert(json.msg);
			}
		},
		error : function(XMLHttpRequest, textStatus, errorThrown) {
			console.log(XMLHttpRequest.status);
			console.log(XMLHttpRequest.readyState);
			console.log(textStatus);
		}
	});
}

function getkeylogin(e) {
	var keynum;
	if (window.event) // IE
	{
		keynum = e.keyCode;
	} else if (e.which) // Netscape/Firefox/Opera
	{
		keynum = e.which;
	}
	if (keynum == 13) {
		dologin();
		return false;
	}
}

//把当前页面的回车键监听事件改成登录
/*
 * document.onkeydown = function(event) { 
 * 			var e = event ? event : (window.event ? window.event : null); 
 * 			if (e.keyCode == 13) {
 * 				 dologin(); 
 * 			} 
 * }
 */